import request from '@/utils/request.js'

// 菜单列表
export const menuList = (params) => {
    return request({
        url: '/sys/menu/list',
        method: 'get',
        params: params
    })
}

// 菜单选择列表
export const menuSelect = () => {
    return request({
        url: '/sys/menu/select',
        method: 'get'
    })
}

// 新增菜单
export const newMenu = (data) => {
    return request({
        url: '/sys/menu/save',
        method: 'post',
        data: data
    })
}

// 菜单详情
export const menuInfo = (id) => {
    return request({
        url: '/sys/menu/info/' + id,
        method: 'get'
    })
}

// 修改菜单
export const editMenu = (data) => {
    return request({
        url: '/sys/menu/update',
        method: 'post',
        data: data
    })
}

// 删除菜单
export const delMenu = (id) => {
    return request({
        url: `/sys/menu/${id}`,
        method: 'delete'
    })
}

// 获取当前用户菜单
export const menuNav = () => {
    return request({
        url: '/sys/menu/nav',
        method: 'get'
    })
}
